package com.wanqing.assistant;

import com.wanqing.assistant.pojo.UserChat;
import dev.langchain4j.service.MemoryId;
import dev.langchain4j.service.SystemMessage;
import dev.langchain4j.service.UserMessage;
import dev.langchain4j.service.V;
import dev.langchain4j.service.spring.AiService;
import reactor.core.publisher.Flux;

import static dev.langchain4j.service.spring.AiServiceWiringMode.EXPLICIT;

@AiService(wiringMode = EXPLICIT,
        chatMemoryProvider = "userChatMemoryProvider",
        streamingChatModel = "qwenStreamingChatModel",
        tools = "userTools")
public interface UserAssistant {
    @SystemMessage(fromResource = "user-prompt-template.md")
    Flux<String> chat(@MemoryId UserChat chat, @UserMessage("抱歉，我现在无法提供帮助，请稍后再试。") String userMessage, @V("userId") Long userId);
}
